<template>
    <div class="adminindex">
        <div class="letop">
            <div class="letopdata">
                <div class="tt">
                    本月招投标申请情况
                    <span>2021-09-01 - 9-31</span>
                </div>
                <div class="letoplist">
                    <div class="letoplist-item">
                        <div class="tta">
                            本月发布招标
                        </div>
                        <div class="num">
                            1,126
                        </div>
                        <div class="data">
                            <div class="ps"> ↑ ↓ 20.2%</div>
                            <p>较上月</p>
                        </div>
                    </div>
                    <div class="letoplist-item">
                        <div class="tta">
                            本月发布招标
                        </div>
                        <div class="num">
                            1,126
                        </div>
                        <div class="data">
                            <div class="ps"> ↑ ↓ 20.2%</div>
                            <p>较上月</p>
                        </div>
                    </div>
                    <div class="letoplist-item">
                        <div class="tta">
                            本月发布招标
                        </div>
                        <div class="num">
                            1,126
                        </div>
                        <div class="data">
                            <div class="ps"> ↑ ↓ 20.2%</div>
                            <p>较上月</p>
                        </div>
                    </div>
                </div>
            </div>
            <div class="lettopbottom">
                <div class="tt">
                    常用工具
                </div>
                <div class="lettopbottomlist">
                    <div class="lettopbottomitem">
                        <img alt="" src="../../assets/Frame-1542.png">
                        <p>
                            发布采购
                        </p>
                    </div>
                    <div class="lettopbottomitem">
                        <img alt="" src="../../assets/Frame-1543.png">
                        <p>
                            查看中标
                        </p>
                    </div>
                    <div class="lettopbottomitem">
                        <img alt="" src="../../assets/Frame-1544.png">
                        <p>
                            消息中心
                        </p>
                    </div>
                </div>
            </div>
        </div>
        <div class="lettopmessage">

            <div class="lettopmessagelist">
                <div v-for="item in 9" class="lettopmessagelistitem">
                    2023-15 【投标信息】XXX公司对XX项目发起了投标
                </div>
            </div>
        </div>

        <div class="bottomlefts">
            <div class="tt">
                供应商列表
            </div>
            <div class="left-list">
                <el-table :data="tableData" border style="width: 100%">
                    <el-table-column label="供应商名称" prop="date" width="180"/>
                    <el-table-column label="负责人" prop="name" width="180"/>
                    <el-table-column label="联系电话" prop="address"/>
                    <el-table-column width="120">
                        <template #default="scope">
                            <el-button
                                link
                                size="small"
                                type="primary"
                                @click.prevent="deleteRow(scope.$index)"
                            >
                                Remove
                            </el-button>
                        </template>
                    </el-table-column>
                </el-table>
            </div>
        </div>
        <div class="bottomright">
            <div class="tt">
                供应商列表
            </div>
            <div class="left-list">
                <el-table :data="tableData" border style="width: 100%">
                    <el-table-column label="供应商名称" prop="date" width="180"/>
                    <el-table-column label="负责人" prop="name" width="180"/>
                    <el-table-column label="联系电话" prop="address"/>
                    <el-table-column width="120">
                        <template #default="scope">
                            <el-button
                                link
                                size="small"
                                type="primary"
                                @click.prevent="deleteRow(scope.$index)"
                            >
                                Remove
                            </el-button>
                        </template>
                    </el-table-column>
                </el-table>
            </div>
        </div>
    </div>
</template>


<script setup>
/**
 * 组件引入
 */
import {onMounted, reactive, ref, computed} from 'vue'
import http from "../../api/api.js"
import msg from "../../utils/Message.js"
import Cookies from "js-cookie";
import {useRouter} from 'vue-router'

/**
 * 全局变量
 * @type {UnwrapNestedRefs<{count: string, list: *[]}>}
 */

const router = useRouter()
const tableData = [
    {
        date: '2016-05-03',
        name: 'Tom',
        address: 'No. 189, Grove St, Los Angeles',
    },
    {
        date: '2016-05-02',
        name: 'Tom',
        address: 'No. 189, Grove St, Los Angeles',
    },
    {
        date: '2016-05-04',
        name: 'Tom',
        address: 'No. 189, Grove St, Los Angeles',
    },
    {
        date: '2016-05-01',
        name: 'Tom',
        address: 'No. 189, Grove St, Los Angeles',
    },
    {
        date: '2016-05-01',
        name: 'Tom',
        address: 'No. 189, Grove St, Los Angeles',
    },
    {
        date: '2016-05-01',
        name: 'Tom',
        address: 'No. 189, Grove St, Los Angeles',
    }


]
/**
 * 页面挂载后
 */
onMounted(() => {
    isLogin()
});

/**
 * 计算属性
 */

/**
 * 方法区
 */


// 是否登录
const isLogin = () => {
    const token = Cookies.get("token")
    if (!token) {
        msg.message("您未登录，请登录", 'error')
    }
}

//跳转路由
function GetLinkUrl(item, index) {
    activeIndex.value = index
    router.push(item.url)
}

</script>

<style lang="scss" scoped>
@import '../../assets/scss/index.scss';
</style>

